package com.teacher.pc.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.teacher.common.CommonResult;
import com.teacher.pojo.dto.goodthings.GoodThingsGetDto;
import com.teacher.pojo.vo.goodthings.GoodThingsGetVo;
import com.teacher.service.IGoodThingsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 好人好事-一条1分 前端控制器
 * </p>
 *
 * @author zfm
 * @since 2021-08-11
 */
@RestController
@RequestMapping("/pc/good-things")
public class GoodThingsController {

    @Autowired
    private IGoodThingsService iGoodThingsService;

    /**
     * 查询好人好事
     *
     * @param dto
     * @return
     */
    @ApiOperation("查询好人好事")
    @GetMapping
    @PreAuthorize("hasAuthority('goodThings_get')")
    public CommonResult<IPage<GoodThingsGetVo>> getPage(GoodThingsGetDto dto) {
        return iGoodThingsService.getPage(dto);
    }

}

